package com.ngkj.zmfptwebsocket.chatModule.service.write.impl;


import com.ngkj.zmfptCommon.common.bean.ChatMessage;

import com.ngkj.zmfptwebsocket.chatModule.mapper.write.ChatMessageMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.ngkj.zmfptwebsocket.chatModule.service.write.ChatMessageService;
import javax.annotation.Resource;

import java.util.List;

/**
 * @author ChenHN
 * @since 2021/11/18 creation
 **/
@Service
public class ChatMessageServiceImpl implements  ChatMessageService{

    @Resource
    private ChatMessageMapper chatMessageMapper;

    @Value("${aes.key}")
    public static String key;

//    private static  SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES,key.getBytes());

    @Override
    public void insertChatMessage(List<ChatMessage> messages) {
        /**
         * 后续可将content加密
         */
        chatMessageMapper.insertChatMessage(messages);

    }

    @Override
    public void updateIsRead(ChatMessage message) {
        chatMessageMapper.updateIsRead(message);
    }
}
